import 'dart:math';

import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';

class ImportFilePage extends StatefulWidget {
  ImportFilePage({Key? key, required this.title}) : super(key: key);

  String title;

  @override
  State<ImportFilePage> createState() => _ImportFilePageState();
}

class _ImportFilePageState extends State<ImportFilePage> {
  void sss(){
    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView.separated(
          itemCount: 1,
          separatorBuilder: (context, index) => const Divider(),
          itemBuilder: (context, index) {
            return TextButton(
                onPressed: () async {
                  final result = await FilePicker.platform.pickFiles(type: FileType.custom, allowedExtensions: ["pdf"]);
                  print(result?.paths);
                },
                child: Text("PDF 文件"));
          }),
    );
  }
}
